﻿using System.Collections.Generic;
using Gameplay.PVE.Utils;
using Unity.Collections;
using Unity.Mathematics;
using UnityEngine;

namespace Yoozoo.Gameplay.RTS
{
    /// <summary>
    /// 方阵数据
    /// </summary>
    public struct MarchSquareNativeData
    {
        public int count;
        public bool inited;
#if UNITY_EDITOR
        public NativeArray<ulong> marchId; //调试用
#endif
        /// <summary>
        /// 是否有效
        /// </summary>
        public NativeArray<bool> valid;
        
       

        public NativeArray<float3> position;

        public NativeArray<int> index;
        
        public NativeArray<float3> forward;
        //变阵索引的Index偏移量
        public NativeArray<int> formationPositionIndexOffset;
        
        //小兵相关
        public NativeArray<int> childIndexHead;
        
        public NativeArray<int> childCount;
        
        /// <summary>
        /// 阵型id
        /// </summary>
        public NativeArray<int> formationId;
        
        /// <summary>
        /// 需要镜像
        /// </summary>
        public NativeArray<int> TurnState;

        /// <summary>
        /// 需要重新计算小兵
        /// </summary>
        public NativeArray<bool> needCalculateChildren;

        /// <summary>
        /// 强行移动小兵
        /// </summary>
        public NativeArray<bool> needForceMoveChildren;
        
        /// <summary>
        /// 方阵的移动速度
        /// </summary>
        public NativeArray<float> speed;


        /// <summary>
        /// 方阵起始位置
        /// </summary>
        public NativeArray<float3> squareStartPosition;
        
        
        /// <summary>
        /// 方阵目标位置
        /// </summary>
        public NativeArray<float3> squareEndPosition;

        public NativeArray<float> segmentStartTime;
        
        /// <summary>
        /// 行军时间
        /// </summary>
        public NativeArray<float> currentSegmentDuration;

        public NativeArray<int> status;

        public NativeArray<bool> changeStatusFlag;
        
        //其他数据
        public NativeArray<int> team;
        
        public NativeArray<float> alpha;

        public NativeArray<bool> overrideAlpha;

        public NativeArray<int> initSoldierNum;
        
        public NativeArray<int> curSoldierNum;

        public NativeArray<uint> soldierTypeList;
        
        // 服务器坐标是否改变，只在战斗中位置移动追击用
        public NativeArray<bool> isServerPosChange;
        
        public NativeArray<bool> isBesiege;

        /// <summary>
        /// 是否正在交战，客户端的状态
        /// </summary>
        public NativeArray<bool> isClientInBattle;

        /// <summary>
        /// 是否是救护车模型
        /// </summary>
        public NativeArray<bool> isEscape;

        //路点信息
        //public NativeArray<MarchPathData> pathData;

    }
}
